const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = {
  lintOnSave: false,//语法检测是否开启严格模式，设置是否在开发环境下每次保存代码时都启用eslint验证。
  productionSourceMap:false,
  devServer:{
    // host: "localhost",
  	port: 8080, // 端口号
  	https: false, // https:{type:Boolean}
  	open: false, //配置自动启动浏览器
  	proxy: {
  		'/api': { //代理api
  			target: 'http://192.168.1.188:8080/m.api',//服务器api地址
  			ws: true,// proxy websockets
  			changeOrigin: true,//是否跨域
  			pathRewrite: { //重写路径
  				'^/api': ''
  			}
  		}
  	},
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver({importStyle:false})],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  },
}
